<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
  <title>tango.net.http.ChunkStream</title>
  <link href="./css/style.css" rel="stylesheet" type="text/css"/>
  <!-- <link href="./img/icon.png" rel="icon" type="image/png"/> -->
  <script type="text/javascript" src="./js/jquery.js"></script>
  <script type="text/javascript" src="./js/modules.js"></script>
  <script type="text/javascript" src="./js/quicksearch.js"></script>
  <script type="text/javascript" src="./js/navigation.js"></script>
  <!--<script type="text/javascript" src="./js/jquery.treeview.js"></script>-->
  <script type="text/javascript">
    var g_moduleFQN = "tango.net.http.ChunkStream";
  </script>
  
</head>
<body>
<div id="content">
  <h1><a href="./htmlsrc/tango.net.http.ChunkStream.html" class="symbol">tango.net.http.ChunkStream</a></h1>
  
<p class="sec_header">License:</p>BSD style: see <a href="http://www.dsource.org/projects/tango/wiki/LibraryLicense">license.txt</a>
<p class="sec_header">Version:</p>Nov 2007: Initial release
<p class="sec_header">Author:</p>Kris
<p class="bl"/>
        Support for HTTP chunked I/O. 
        
        See http://www.w3.org/Protocols/rfc2616/rfc2616-sec3.html
<dl>
<dt class="decl">class <a class="symbol _class" name="ChunkOutput" href="./htmlsrc/tango.net.http.ChunkStream.html#L35" kind="class" beg="35" end="93">ChunkOutput</a> : OutputFilter, Buffered; <a title="Permalink to this symbol" href="#ChunkOutput" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/tango.net.http.ChunkStream.html#L35">#</a></dt>
<dd class="ddef">
<div class="summary">Prefix each block of data with its length (in hex digits) and add
        appropriate \r\n sequences. To commit the stream you'll need to use
        the terminate() function and optionally provide it with a callback 
        for writing trailing headers</div>
<dl>
<dt class="decl"><a class="symbol _ctor" name="ChunkOutput.this" href="./htmlsrc/tango.net.http.ChunkStream.html#L45" kind="ctor" beg="45" end="48">this</a><span class="params">(OutputStream <em>stream</em>)</span>; <a title="Permalink to this symbol" href="#ChunkOutput.this" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/tango.net.http.ChunkStream.html#L45">#</a></dt>
<dd class="ddef">
<div class="summary">Use a buffer belonging to our sibling, if one is available</div></dd>
<dt class="decl">IBuffer <a class="symbol _function" name="ChunkOutput.buffer" href="./htmlsrc/tango.net.http.ChunkStream.html#L56" kind="function" beg="56" end="59">buffer</a><span class="params">()</span>; <a title="Permalink to this symbol" href="#ChunkOutput.buffer" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/tango.net.http.ChunkStream.html#L56">#</a></dt>
<dd class="ddef">
<div class="summary">Buffered interface</div></dd>
<dt class="decl">uint <a class="symbol _function" name="ChunkOutput.write" href="./htmlsrc/tango.net.http.ChunkStream.html#L68" kind="function" beg="68" end="77">write</a><span class="params">(void[] <em>src</em>)</span>; <span class="attrs">[<span class="stc">override</span>, <span class="stc">final</span>]</span> <a title="Permalink to this symbol" href="#ChunkOutput.write" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/tango.net.http.ChunkStream.html#L68">#</a></dt>
<dd class="ddef">
<div class="summary">Write a chunk to the output, prefixed and postfixed in a 
                manner consistent with the HTTP chunked transfer coding</div></dd>
<dt class="decl">void <a class="symbol _function" name="ChunkOutput.terminate" href="./htmlsrc/tango.net.http.ChunkStream.html#L86" kind="function" beg="86" end="92">terminate</a><span class="params">(void delegate(IBuffer) <em>headers</em> = null)</span>; <span class="attrs">[<span class="stc">final</span>]</span> <a title="Permalink to this symbol" href="#ChunkOutput.terminate" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/tango.net.http.ChunkStream.html#L86">#</a></dt>
<dd class="ddef">
<div class="summary">Write a zero length chunk, trailing headers and a terminating 
                blank line</div></dd></dl></dd>
<dt class="decl">class <a class="symbol _class" name="ChunkInput" href="./htmlsrc/tango.net.http.ChunkStream.html#L105" kind="class" beg="105" end="172">ChunkInput</a> : LineIterator!(char); <a title="Permalink to this symbol" href="#ChunkInput" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/tango.net.http.ChunkStream.html#L105">#</a></dt>
<dd class="ddef">
<div class="summary">Parse hex digits, and use the resultant size to modulate requests 
        for incoming data. A chunk size of 0 terminates the stream, so to
        read any trailing headers you'll need to provide a delegate handler
        for receiving those</div>
<dl>
<dt class="decl"><a class="symbol _ctor" name="ChunkInput.this" href="./htmlsrc/tango.net.http.ChunkStream.html#L119" kind="ctor" beg="119" end="124">this</a><span class="params">(InputStream <em>stream</em>, Headers <em>headers</em> = null)</span>; <a title="Permalink to this symbol" href="#ChunkInput.this" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/tango.net.http.ChunkStream.html#L119">#</a></dt>
<dd class="ddef">
<div class="summary">Prime the available chunk size by reading and parsing the
                first available line</div></dd>
<dt class="decl">uint <a class="symbol _function" name="ChunkInput.nextChunk" href="./htmlsrc/tango.net.http.ChunkStream.html#L132" kind="function" beg="132" end="139">nextChunk</a><span class="params">()</span>; <span class="attrs">[<span class="prot">private</span>, <span class="stc">final</span>]</span> <a title="Permalink to this symbol" href="#ChunkInput.nextChunk" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/tango.net.http.ChunkStream.html#L132">#</a></dt>
<dd class="ddef">
<div class="summary">Read and parse another chunk size</div></dd>
<dt class="decl">uint <a class="symbol _function" name="ChunkInput.read" href="./htmlsrc/tango.net.http.ChunkStream.html#L147" kind="function" beg="147" end="171">read</a><span class="params">(void[] <em>dst</em>)</span>; <span class="attrs">[<span class="stc">override</span>, <span class="stc">final</span>]</span> <a title="Permalink to this symbol" href="#ChunkInput.read" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/tango.net.http.ChunkStream.html#L147">#</a></dt>
<dd class="ddef">
<div class="summary">Read content based on a previously parsed chunk size</div></dd></dl></dd></dl>
</div>
<div id="footer">
  <p>Copyright (c) Nov 2007 Kris Bell. All rights reserved</p>
  <p>Page generated by <a href="http://code.google.com/p/dil">dil</a> on Fri Dec 26 04:03:57 2008. Rendered by <a href="http://code.google.com/p/dil/wiki/Kandil">kandil</a>.</p>
</div>
</body>
</html>